<template>
	<view class="box">
		<view class="bg"></view>
		<view class="list">
			<!-- 订单状态 -->
			<view class="state card">
				<block v-if="info.paid!=1 && (info.is_del == 0 || info.task_status != 6)">
					<view class="state-text f32" style="margin-top: 30rpx;" v-if="info.task_status != 6">待支付</view>
					<view class="state-text f32" style="margin-top: 30rpx;" v-else>已取消</view>
					<view class="state-desc f24 c999">请在倒计时内尽快完成支付，超时订单将自动取消</view>
				</block>
				<block v-if="info.paid==1">
					<block v-if="info.task_status==3">
						<view class="state-text f32" style="margin-top: 30rpx;">待配送</view>
						<view class="state-desc f24 c999">您的订单正在备货，请耐心等待</view>
					</block>
					<block v-if="info.task_status==5">
						<view class="state-text f32" style="margin-top: 30rpx;">已完成</view>
						<view class="state-desc f24 c999">您的订单已完成，可以再次购买哦</view>
					</block>
				</block>
				<view class="state-btn fw-ct" style="flex-wrap: wrap">
					<view @click.stop="cancelOrder" style="margin-bottom: 15rpx;margin-top: 15rpx;"
						v-if="info.paid!=1&&(info.task_status==1||info.task_status==2||info.task_status==3)">取消订单</view>
					<view @click.stop="updateAddressOrder(id)" v-if="info. is_del !=1 &&info.task_status ==1"
						style="margin-bottom: 15rpx;margin-top: 15rpx;">修改地址
					</view>
					<view @click.stop="updateDateOrder(id)" v-if="info.is_del !=1 &&info.task_status ==1"
						style="margin-bottom: 15rpx;margin-top: 15rpx;">修改配送时间</view>
					<view @click.stop="goPayOrder" class="state1" v-if="info.paid!=1 && info.is_del !=1 && info.task_status != 6"
						style="margin-bottom: 15rpx;margin-top: 15rpx;margin-right: 20rpx;">
						去支付{{(info.m<10?'0'+info.m:info.m)+':'+(info.s<10?'0'+info.s:info.s)}}</view>
					<view @click.stop="reminderOrder(id)" :class="info.psy?'state3':'state2'"
						style="margin-bottom: 15rpx;margin-top: 15rpx;"
						v-if="info.task_status==3&&info.is_urge == 0&&info.paid==1 &&info.is_del==0">催单</view>
					<view @click.stop="applyTicket" v-if="info.is_receipt_apply==1"
						style="margin-bottom: 15rpx;margin-top: 15rpx;">申请开票
					</view>
					<view @click.stop="goEvaluation" v-if="info.task_status==5&&info.status == 2"
						style="margin-bottom: 30rpx;">去评价</view>
					<view @click.stop="delOrder(info)" v-if="info.task_status==6"
						style="margin-bottom: 15rpx;margin-top: 15rpx;">
						删除订单</view>
					<view @click.stop="againOrder" class="state2" style="margin-bottom: 15rpx;margin-top: 15rpx;"
						v-if="info.paid==1&&(info.task_status==6||info.task_status==5)">再来一单</view>
				</view>
			</view>
			<!-- 骑手信息 -->
			<block v-for="(item,index) in info.task" v-show="info.task">
				<view class="msg card">
					<view class="msg-title f28 fw-bt">
						<view class="bold">
							<template v-if="item.task_type == 1">
								买手信息
							</template>
							<template v-if="item.task_type == 2">
								骑手信息
							</template>
							<template v-if="item.task_type == 3">
								骑手信息 退货单
							</template>
							<template v-if="item.task_type ==  4">
								买手信息 换货单
							</template>
							<template v-if="item.task_type ==  5">
								骑手 换货单
							</template>
						</view>
						<template
							v-if="(item.status != 3 && item.status != 4 ) && (item.task_type == 2 || item.task_type == 4 || item.task_type == 5) && (index == info.task.length -1)">
							<view class="red">{{riderdistance}}</view>
						</template>
						<view v-if="item.status == 3 && item.evaluate_date == null" @click="gotoEvaluateTask(item)">去评价
							></view>
					</view>
					<view class="msg-buy f-w">
						<view class="msg-buy1 f-w">
							<image :src="item.application.avatar" mode=""></image>
						</view>
						<view class="msg-buy2">
							<view class="msg-buy21 fw-bt f26">
								<view>{{item.application.real_name}}</view>
								<view>{{item.application.phone}}</view>
							</view>
							<view class="msg-buy22 fw-bt f22">
								<view class="c999">{{item.merchantField.mer_name}}</view>
								<view class="red" @click="call(item.application.phone)">
									{{(item.task_type == 2 || item.task_type == 4 || item.task_type == 5) ? '骑手':'买手'}}电话
								</view>
							</view>
						</view>
					</view>
				</view>
			</block>


			<!-- 订单信息 -->
			<view class="order card">
				<block v-for="(item,index) of info.orderList" :key="index">
					<view class="title  fw-bt">
						<view class="f28 bold">{{item.merchantField.mer_name}}</view>
						<view class="f26 f-w" @click="call(item.merchantField.service_phone)">
							<view class="title-img f-w">
								<image src="https://jw.xzsw2021.com/static/order/icon_201@2x.png" mode=""></image>
							</view>
							<view>联系商家</view>
						</view>
					</view>
					<view class="order-list">
						<view class="shop" v-for="(item2,index2) of item.orderProduct" :key="index2">
							<!-- 申请售后 -->
							<view class="shouhou" @click="goAfterSales(item2.product_id)" v-if="item2.pid==1">申请售后
							</view>
							<view class="f-w">
								<view class="shop-msg f-w">
									<image :src="item2.cart_info.productAttr.image" mode=""></image>
								</view>
								<view class="shop-right">
									<view class="one fw-bt">
										<view class="shop-name f28 c333 hide-line">
											{{item2.cart_info.product.store_name}} 
											<view style="color: #F83535;">
												{{item2.cart_info.productAttr.sku||''}}
											</view>
										</view>
										<view class="f-w">
											<!-- <view class="price1" v-if="item2.cart_info.productAttr.ot_price">
												￥{{item2.cart_info.productAttr.ot_price}}
											</view> -->
											<!-- <view class="price2 f28 bold">￥{{item2.product_price}}</view> -->
											<view class="price2 f28 bold">￥{{item2.cart_info.productAttr.price}}</view>
										</view>

									</view>
									<!-- <view class="two hide-line">{{item2.productAttr.ot_price}}</view> -->
									<!-- 数量 -->
									<view class="three">×{{item2.product_num}}</view>
									<!-- {{item2.is_reply}}@{{item.status}} -->
									<view v-if="item2.is_reply == 0 && item.status == 2 && item2.refund_num > 0"
										@click="gotoEvaluateOrderProudct(item2.order_product_id)">
										去评价 >
									</view>
								</view>

							</view>
							<!-- 差价 -->
							<view class="chajia" @click="ChajiaDesc(item2)" v-if="item2.lack_weight_refund > 0">
								<view>
									因为重量误差，产生差价{{item2.lack_weight_refund}}元
									<view class="img2 f-w">
										<image src="https://jw.xzsw2021.com/static/order/icon_137@2x.png" mode="">
										</image>
									</view>
								</view>
							</view>
						</view>

					</view>
					<!-- <u-cell-group>
						<u-cell :value="item.order_sn" label="商户单号" center></u-cell>
					</u-cell-group> -->
					<!-- v-if="info.task_status == 5 && item.status == 1" -->
					<view class="" style="display: flex;justify-content: flex-end;"
						v-if="info.task_status == 5 && item.status == 1">
						<!-- 商户单号：{{item.order_sn}} -->
						<view class="sureshbtn" @click="merOrderReceipt(item.order_id)" >
							确认收货
						</view>
					</view>
					<!-- <view class="" v-else>
					
					</view> -->
				</block>


				<!-- 共5件 -->
				<view class="num fw-ct" v-if="info.total_num" @click="showAll">
					共{{info.total_num}}件
					<view class="tag2 f-w">
						<image src="https://jw.xzsw2021.com/static/img/icon_63@2x.png" mode="" v-if="showMore"></image>
						<image src="https://jw.xzsw2021.com/static/img/icon_62@2x.png" mode="" v-else></image>
					</view>
				</view>
				<!-- 包装费 -->
				<view class="fee1 fw-bt f28">
					<view>包装费</view>
					<view>￥{{info.order_total_package_fee}}</view>
				</view>
				<!-- 配送费 -->
				<view class="fee2 fw-bt f28">
					<view>配送费</view>
					<view>￥{{info.pay_postage}}</view>
				</view>


				<!-- 积分抵现 -->
				<view class="demo fw-bt" v-if="info.integral_price > 0">
					<view class="f-w">
						<view class="img1 f-w">
							<image src="https://jw.xzsw2021.com/static/order/icon_138@2x.png" mode=""></image>
						</view>
						<view class="title2" @click="openPop2(1)">
							<view>
								积分抵现
								<view class="img2 f-w">
									<image src="https://jw.xzsw2021.com/static/order/icon_137@2x.png" mode=""></image>
								</view>
							</view>
						</view>
					</view>
					<!--  -->
					<view class="red f28 red">-￥{{info.integral_price}}</view>
				</view>
				<!-- 红包 -->
				<view class="demo fw-bt" v-if="info.total_free_money_sum > 0">
					<!-- 左边 -->
					<view class="f-w">
						<view class="img1 f-w">
							<image src="https://jw.xzsw2021.com/static/order/icon_139@2x.png" mode=""></image>
						</view>
						<view class="title2" @click="openPop2(2)">
							红包
							<view class="img2 f-w">
								<image src="https://jw.xzsw2021.com/static/order/icon_137@2x.png" mode=""></image>
							</view>
						</view>
					</view>
					<!-- 右边 -->
					<view class="f-w">
						<view class="f28 c999 red">-￥{{info.total_free_money_sum}}</view>
					</view>
				</view>
				<!-- 配送费红包 -->
				<view class="demo fw-bt" v-if="info.total_free_postage_money_sum">
					<!-- 左边 -->
					<view class="f-w">
						<view class="img1 f-w">
							<image src="https://jw.xzsw2021.com/static/order/icon_140@2x.png" mode=""></image>
						</view>
						<view class="title2" @click="openPop2(3)">
							配送费红包
							<view class="img2 f-w">
								<image src="https://jw.xzsw2021.com/static/order/icon_137@2x.png" mode=""></image>
							</view>
						</view>
					</view>
					<!-- 右边 -->
					<view class="f-w">
						<view class="f28 c999 red">-￥{{info.total_free_postage_money_sum}}</view>
					</view>
				</view>
				<!-- 优惠券 -->
				<view class="demo fw-bt" v-if="info.coupon_price > 0">
					<!-- 左边 -->
					<view class="f-w">
						<view class="img1 f-w">
							<image src="https://jw.xzsw2021.com/static/order/icon_141@2x.png" mode=""></image>
						</view>
						<view class="title2" @click="openPop2(4)">
							优惠券
							<view class="img2 f-w">
								<image src="https://jw.xzsw2021.com/static/order/icon_137@2x.png" mode=""></image>
							</view>
						</view>
					</view>
					<!-- 右边 -->
					<view class="f-w">
						<view class="f28 c999 red">-￥{{info.coupon_price}}</view>
					</view>
				</view>


				<!-- 优惠券 -->
				<view class="lpkdemo fw-bt" v-if="info.card_price > 0">
					<!-- 左边 -->
					<view class="f-w">
						<view class="img1 f-w" style="height: 36rpx;">
							<image src="https://jw.xzsw2021.com/static/order/icon_141@2x.png" mode=""></image>
						</view>
						<view class="title2">礼品卡</view>
					</view>
					<!-- 右边 -->
					<view class="f-w">
						<view class="f28 c999 red">-￥{{info.card_price}}</view>
					</view>
				</view>
				<!-- 已优惠 -->
				<view class="youhui fw-bt">
					<!--  -->
					<view class="f26 f-w">
						<text class="yyh">已优惠</text>
						<text class="red f28" v-if="info.pay_price < info.total_price">
							￥<text class="f34">
								{{YYH}}
							</text>
						</text>
						<text class="red f28" v-else>
							￥<text class="f34">{{YYH}}</text>
						</text>

						<!-- 						<text class="red f28">￥<text class="f34">{{info.pay_price*1-info.total_price*1}}</text></text> -->
					</view>
					<!-- 小计 -->
					<view class="f26 f-w">
						<view class="xiaoji">小计</view>
						<view class="f28 f-w">
							￥
							<view class="youhui-total f40">
								{{info.pay_price}}
								<view class="sanjiao"></view>
							</view>
						</view>
					</view>
				</view>
				<!-- plus节省 -->
				<view class="yh-plus f-w" v-if="true">
					<view class="img3 f-w">
						<image src="https://jw.xzsw2021.com/static/order/zhuanshi.png" mode="widthFix"></image>
					</view>
					<view>PLUS会员</view>
					<view class="tag3"></view>
					<view>本单已为您节省￥{{info.sumVipDiscountMoney}}</view>
				</view>
				<view class="yh-plus fw-bt" v-else-if="false">
					<!-- 非会员才显示 -->
					<view class="f-w">
						<view class="img3 f-w">
							<image src="https://jw.xzsw2021.com/static/order/zhuanshi.png" mode="widthFix"></image>
						</view>
						<view>成为PLUS会员</view>
						<view class="tag3"></view>
						<view>可为您节省￥{{info.IfVipDiscountMoney}}</view>
						<!-- 商品都不支持折扣时  IfVipDiscountMoney 值为0 -->
					</view>
					<view class="red" @click="getPlus">去开通＞</view>
				</view>
			</view>
			<!-- 配送信息 -->
			<view class="ps-msg card">
				<view class="title">配送信息</view>
				<view class="p2">
					<view class="flex">
						<view class="label">收货地址:</view>
						<view>{{`${info.real_name||''} ${info.user_phone||''} ${info.user_address||''}`}}</view>
					</view>
					<view class="f-w">
						<view class="label">配送时间:</view>
						<view class="orange">{{info.delivery_day}} {{info.delivery_time_scope}}</view>
					</view>
				</view>
			</view>
			<!-- 备注 -->
			<view class="card note">
				<view class="title">备注</view>
				<view class="p2">
					<view v-for="item in info.orderList">{{item.mark}}</view>
				</view>
			</view>
			<!-- 订单信息 -->
			<view class="order-msg card">
				<view class="title">订单信息</view>
				<view class="p2">
					<view class="2 f-w">
						<view class="label">总单编号:</view>
						<view class="fw-bt">
							<view>{{info.group_order_sn}}</view>
							<view class="orange" @click="copy">复制</view>
						</view>
					</view>
					<view class="f-w">
						<view class="label">下单时间:</view>
						<view>{{info.create_time2}}</view>
					</view>
				</view>
			</view>
		</view>
		<!-- 删除订单-->
		<view class="bottom2" style="z-index: 2;" v-if="info.task_status==6&&info.paid==1">
			<view @click="delOrder(info)">删除订单</view>
		</view>

		<!-- 说明弹窗 -->
		<uni-popup ref="popup2" type="center" :isMaskClick="false">
			<view class="pop2">
				<view class="pop2-content">
					积分底线说明
				</view>
				<view class="pop2-close f-w" @click="pop2Close">
					<image src="https://jw.xzsw2021.com/static/index/icon_19@2x.png" mode=""></image>
				</view>
			</view>
		</uni-popup>
		<!-- 配送时间弹窗 -->
		<uni-popup ref="popup3" type="bottom" :isMaskClick="false">
			<view class="pop3">
				<!--  -->
				<view class="pop3-close f-w" @click="pop3Close">
					<image src="https://jw.xzsw2021.com/static/order/icon_200@2x.png" mode=""></image>
				</view>
				<view class="pop3-title tr f30">
					配送时间
				</view>
				<!-- 内容区 -->
				<view class="pop3-box flex">
					<view class="pop3-left">
						<view v-for="(item,index) of date_list" :key="index" class="tr"
							:class="activeT===index?'green2':''" @click="checkDate(index)">{{item}}</view>
					</view>
					<view class="pop3-right">
						<view class="aa fw-bt" v-for="(item,index) of times_list" :key="index"
							@click="chooseTimes(index)">
							<view :class="active2===index?'green2':''">{{item.tips}}{{item.start}}-{{item.end}}</view>
							<view class="pop3-img" v-if="active2==index">
								<image src="https://jw.xzsw2021.com/static/order/icon_149@2x.png" mode=""></image>
							</view>
						</view>
					</view>
				</view>
			</view>
		</uni-popup>

		<!-- 支付弹窗 -->
		<uni-popup ref="popup4" type="bottom" :isMaskClick="false">
			<view class="pop4">
				<view class="pop4-close f-w" @click="pop4Close">
					<image src="https://jw.xzsw2021.com/static/order/icon_200@2x.png" mode=""></image>
				</view>
				<view class="pop4-title f30 bold tr">
					以下订单需要一起付款
				</view>
				<view class="pop4-desc tr">由于以下订单共享优惠，需要一起付款</view>
				<view class="pop4-list">
					<view class="fw-bt" v-for="(item,index) of choosecancelitem.orderList" :key="index">
						<view class="f28">
							<view>{{item.merchantField.mer_name}}</view>
							<view>(共{{item.total_num}}件)</view>
						</view>
						<view class="orange">￥<text class="f34">{{item.pay_price*1}}</text></view>
					</view>
				</view>
				<!-- 按钮 -->
				<view class="pop4-btn f-w">
					<view class="p41" @click="pop4Close">取消</view>
					<view class="p41" @click="paychoose">付款</view>
				</view>
			</view>
		</uni-popup>
		<!-- 支付弹窗 -->
		<uni-popup ref="popup5" type="bottom">
			<view class="pop4">
				<view class="pop4-close f-w" @click="()=>{this.$refs.popup5.close()}">
					<image src="https://jw.xzsw2021.com/static/order/icon_200@2x.png" mode=""></image>
				</view>
				<view class="pop4-title f30 bold tr">
					以下订单需要一起取消
				</view>
				<view class="pop4-desc tr">由于以下订单共享优惠，需要一起取消</view>
				<view class="pop4-list">
					<view class="fw-bt" v-for="(item,index) of choosecancelitem.orderList" :key="index">
						<view class="f28">
							<view>{{item.merchantField.mer_name}}</view>
							<view>(共{{item.total_num}}件)</view>
						</view>
						<view class="orange">￥<text class="f34">{{item.pay_price*1}}</text></view>
					</view>
				</view>
				<!-- 按钮 -->
				<view class="pop4-btn f-w">
					<view class="p41" @click="pop5Sure">确认取消</view>
					<view class="p41" @click="()=>{this.$refs.popup5.close()}">我再想想</view>
				</view>
			</view>
		</uni-popup>
		<!-- 取消原因弹窗 -->
		<uni-popup ref="popup6" type="center" :isMaskClick="false">
			<view class="pop6">
				<view class="pop6-title f30  tr">
					请选择取消订单原因
				</view>
				<view class="pop6-list">
					<u-radio-group v-model="radiovalue1" placement="column" iconPlacement="right" @change="groupChange">
						<u-radio :customStyle="{marginBottom: '45rpx'}" v-for="(item, index) in radiolist1" :key="index"
							:label="item.name" :name="item.name" labelColor="#333" iconSize="15" activeColor="#22B591">
						</u-radio>
					</u-radio-group>
				</view>
				<view class="pop6-btn bold f28 tr f-w">
					<view class="c999" @click="pop6Sure">确认取消</view>
					<view class="red" @click="pop6Close">我再想想</view>
				</view>
			</view>
		</uni-popup>
		<uni-popup ref="popup7" type="center" :isMaskClick="false">
			<view class="pop7">
				<view class="pop7-img f-w">
					<image src="https://jw.xzsw2021.com/static/big/icon_208@2x.png" mode=""></image>
				</view>
				<!--  -->
				<view class="tr">
					<view class="pop7-title f36 bold">请您耐心等待</view>
					<!-- <view class="pop7-title f36 bold">催单成功</view>
					<view class="pop7-desc f24 c666">我们会尽快安排骑手配送</view> -->
					<view class="pop7-desc f24 c666">商品正在配货中</view>
					<view class="pop7-btn" @click="pop7Close">知道了</view>
				</view>
			</view>
		</uni-popup>
		<!-- 差价弹窗 -->
		<uni-popup ref="popup8" type="bottom" :isMaskClick="false">
			<view class="pop8">
				<view class="pop8-close f-w" @click="pop8Close">
					<image src="https://jw.xzsw2021.com/static/order/icon_200@2x.png" mode=""></image>
				</view>
				<view class="pop8-title bold f32 tr">
					差价说明
				</view>
				<view class="pop8-desc">
					<!-- {{msbz}} -->
					由于实际称重产生误差，确认收货后差价将退至账户余额，请注意查收
					<br>
					注意：退款金额不会超过实际付款金额
				</view>
				<view class="pop8-btn" @click="pop8Close">确定</view>
			</view>
		</uni-popup>
	</view>
</template>

<script>
	import {
		getGrade
	} from '@/api/grade'

	import {
		orderTakeApi,
		againApi,
		orderCheckApi,
		userDeleteGroupOrderApi
	} from '@/api/order.js'
	import Cache from '@/util/cache.js'
	export default {
		data() {
			return {
				address: "",
				changeaddr: false,
				chooseid: '',
				YYH: 0,
				closetime: '',
				info: "",
				riderdistance: "", //骑手距离
				state: 4, ////1.待支付 2.待配送 3.配送中 4.已完成 5.已取消
				state_desc: '', //状态说明
				name: '老粉',
				mobile: '131313',
				showMore: false, //展示全部
				range: true, //配送范围
				djs: '', //倒计时
				order: {
					end_time: '2022-02-15 14:37',
					time: '',
				},
				msbz: "",
				address: {
					address: '1313'
				},
				rider: {
					id: 32,
					name: '梁鹏',
					mobile: '18357457899',
				}, //骑手信息

				cart_list: [], //
				is_dixian: true, //是否抵现
				pay_wx: true, //支付方式 1微信 0余额
				pay_yue: false,
				note1: '', //待用备注
				note: '', //备注
				date_list: ['今天', '明天'], //
				active: 0, //
				active2: 0, //
				times_list: [{
						tips: '立即送达',
						start: '10:00',
						end: '12:00'
					},
					{
						tips: '',
						start: '12:00',
						end: '14:00'
					},
					{
						tips: '',
						start: '14:00',
						end: '16:00'
					},
					{
						tips: '',
						start: '16:00',
						end: '18:00'
					},
					{
						tips: '',
						start: '18:00',
						end: '20:00'
					},
					{
						tips: '',
						start: '20:00',
						end: '22:00'
					}
				], //送达时间列表
				temp: null, //
				// 基本案列数据
				radiolist1: [{
						name: '商品无货',
						disabled: false
					},
					{
						name: '发货时间问题',
						disabled: false
					},
					{
						name: '不想要了',
						disabled: false
					}, {
						name: '商品错选/多选',
						disabled: false
					},
					{
						name: '地址信息填写错误 ',
						disabled: false
					},
					{
						name: '价格贵了',
						disabled: false
					},
					{
						name: '没用/少用/错用优惠',
						disabled: false
					},
					{
						name: '其他',
						disabled: false
					}
				], //取消原因数据
				// u-radio-group的v-model绑定的值如果设置为某个radio的name，就会被默认选中
				radiovalue1: '商品无货',
				id: '',
				activeT: 0,
				cuifocontent: '',
				cuifotitle: '',
				choosecancelitem: '',
				grade: [],
				task_status:''
			}
		},
		watch: {
			address(n, o) {
				console.log(n, "旧：", o);
				if (n) {
					// 当新值存在时，检测是否超出配送范围
					this.range = false
					if (!this.range) {
						this.$showToast('配送地址超出范围，请重新选择')
					}
				}
			}
		},
		computed: {
			cart_list2: {
				get() {
					let arr = [];
					if (this.showMore) {
						arr = this.cart_list.slice(0);
					} else {
						arr = this.cart_list.slice(0, 3);
					}
					return arr;
				}
			},
			state_name() {

			}
		},
		onLoad(e) {
			this.id = e.id
			this.task_status =e.task_status? e.task_status :''
			// this.YYH = 0
			this.closetime = e.closetime ? e.closetime : 30
			this.timer();
			this.getcancellist()
			// this.$refs.popup3.open();
		},
		onShow() {
			if (this.changeaddr && this.address && this.chooseid) {
				this.getupdateAddressOrder()
			} else {
				this.getgoodsinfo()
			}

		},
		onHide() {
			this.endInter()
		},
		onUnload: function() {
			this.endInter()
		},
		methods: {
			merOrderReceipt(orderId) {
				orderTakeApi(orderId).then(res => {
					wx.showToast({
						title: res.message,
						icon: 'none'
					})

					this.getgoodsinfo()

				}).catch(err => {
					wx.showToast({
						title: err.message,
						icon: 'none'
					})
				})
			},
			endInter: function() {

				let {
					info
				} = this;

				clearInterval(info.timer);


			},
			/**
			 * 随便获取一个永远折扣的会员等级
			 */
			getVipDiscount() {
				if (this.grade.length == 0) {
					getGrade().then(res => {
						this.grade = res.data
					})
				}
				let Grade = false;
				this.grade.forEach(grade => {
					console.log(grade)
					if (grade.discount > 0) {
						Grade = grade
					}
				})
				return Grade;
			},
			timeCountDown() {
				let v = this.info

				// 开定时器时先关闭定时器
				if (v.timer) {
					clearInterval(v.timer);
				}

				v.timer = setInterval(() => {
					v.endtime = v.endtime - 1000
					if (v.endtime <= 0) {
						v.d = 0
						v.h = 0
						v.m = 0
						v.s = 0
						if (v.timer) {
							// 自动完成这里造成了死循环
							clearInterval(v.timer);
							// this.completeOrder(v.order_id, v);
						} // 刷新进行中

					} else {
						this.$set(v, 'd', Math.floor(v.endtime / 1000 / 60 / 60 / 24))
						this.$set(v, 'h', Math.floor(v.endtime / 1000 / 60 / 60 % 24))
						this.$set(v, 'm', Math.floor(v.endtime / 1000 / 60 % 60))
						this.$set(v, 's', Math.floor(v.endtime / 1000 % 60))
					}

				}, 1000);

			},

			formatDate(now) {
				var year = now.getFullYear();
				var month = now.getMonth() + 1;
				var date = now.getDate();
				var hour = now.getHours();
				var minute = now.getMinutes();
				var second = now.getSeconds();
				minute = minute >= 10 ? minute : '0' + minute
				second = second >= 10 ? second : '0' + second
				hour = hour >= 10 ? hour : '0' + hour
				return year + "-" + month + "-" + date + " " + hour + ":" + minute + ":" + second;
			},
			getcancellist() {
				this.$request.get('order/refund_message').then(res => {
					if (res.status == 200) {
						let arr = []
						this.radiovalue1 = res.data[0]
						res.data.forEach(item => {
							arr.push({
								disabled: false,
								name: item
							})
						})
						this.radiolist1 = arr
					}
				})
			},
			getDay(day, hours) {
				var today = new Date()
				var targetday = today.getTime() + 1000 * 60 * 60 * 24 * day + hours
				today.setTime(targetday)
				var tYear = today.getFullYear()
				var tMonth = today.getMonth()
				var tDate = today.getDate()
				tMonth = this.doHandleMonth(tMonth + 1)
				tDate = this.doHandleMonth(tDate)
				return tYear + '-' + tMonth + '-' + tDate
			},
			doHandleMonth(month) {
				var m = month
				if (month.toString().length === 1) {
					m = '0' + month
				}
				return m
			},
			// 改变地址
			getupdateAddressOrder() {


				uni.showLoading({
					mask: true,
					title: "地址修改中"
				})
				this.$request('order/change_address', {
					group_order_id: this.chooseid,
					address_id: this.address.address_id
				}).then(res => {
					this.chooseid = ''
					this.address = ''
					this.changeaddr = false
					this.getgoodsinfo()
					uni.hideLoading()


				})

			},
			/**
			 * 评价任务
			 * @param {Object} task 
			 */
			gotoEvaluateTask(task) {
				let type = 0;
				if (task.task_type == 1 || task.task_type == 4) { //买手
					type = 2
				} else {
					type = 3
				}
				uni.navigateTo({
					url: `/pages/client/order/evaluation/evaluation?type=${type}&task_id=${task.id}&order_group_id=${task.order_id}`
				})
			},
			gotoEvaluateOrderProudct(order_product_id) {
				uni.navigateTo({
					url: `/pages/client/order/evaluation/evaluation?type=1&order_product_id=${order_product_id}`
				})
			},
			// 获取商品详情
			getgoodsinfo() {
				let that = this
				this.YYH = 0
				this.$request("order/group_order_detail2/" + this.id, {task_status:this.task_status}, 'GET').then(res => {
					if (res.data.paid != 1) {
						uni.setNavigationBarTitle({
							title: res.data.task_status != 6? '待支付':'已取消'
						})
					} else {

						if (res.data.task_status == 1) {

							uni.setNavigationBarTitle({
								title: '待帮买'
							})
						}
						if (res.data.task_status == 2) {

							uni.setNavigationBarTitle({
								title: '帮买中'
							})
						}
						if (res.data.task_status == 3) {

							uni.setNavigationBarTitle({
								title: '待配送'
							})
						}
						if (res.data.task_status == 4) {

							uni.setNavigationBarTitle({
								title: '配送中'
							})
						}
						if (res.data.task_status == 5) {

							uni.setNavigationBarTitle({
								title: '配送完成'
							})
						}
						if (res.data.task_status == 6) {
                                 
								 let txt=''
								 if(res.data.cancel_examine==1){
								 	txt='审核中'
								 }
								 if(res.data.cancel_examine==2){
								 	txt='成功'
								 }
								 if(res.data.cancel_examine==3){
								 	txt='失败'
								 }

                                 
							uni.setNavigationBarTitle({
								title: '取消'+txt
							})
						}

					}
					this.info = res.data

					this.info.orderList.forEach(item => {
						if (item.sumVipDiscountMoney) {
							this.info.sumVipDiscountMoney += item.vip_discount_money
						} else {
							this.info.sumVipDiscountMoney = item.vip_discount_money
						}
						item.orderProduct.forEach(productInfo => {
							let cartInfo = productInfo.cart_info
							if (cartInfo.product.reduceMoeny) { //满件打折金额
								that.YYH += Number(cartInfo.product.reduceMoeny)
							}
							// console.log(that.getVipDiscount())
							if (cartInfo.productAttr.is_member_discount) { //是否支持会员折扣
								if (cartInfo.product.vip_discount_price > 0) {
									that.YYH += Number(cartInfo.product.vip_discount_price) // 会员优惠
								}

								// let vip = that.getVipDiscount()
								// if (vip && that.info.IfVipDiscountMoney) { //假如开会员可折扣金额

								// } else {
								// 	// that.info.IfVipDiscountMoney += ;
								// }
							}
						});
					})
					this.YYH += Number(this.info.card_price) //礼品卡抵扣金额
					this.YYH += Number(this.info.integral_price) //积分抵扣金额
					this.YYH += Number(this.info.coupon_price) //优惠券抵扣金额
					this.YYH += Number(this.info.total_free_postage_money_sum) //总免运费红包金额
					this.YYH += Number(this.info.total_free_money_sum) //总满减金额

					this.YYH = this.YYH.toFixed(2)
					res.data.create_time2 = res.data.create_time
					res.data.create_time = (new Date(res.data.create_time).getTime()) / 1000
					res.data.endtime = (res.data.create_time * 1000 + (this.closetime * 1) * 60 * 1000 - 
					new Date().getTime())
					this.timeCountDown()

					let k = res.data.task.length
					k -= 1
					let lat1 = res.data.task[k].application.latitude
					let lng1 = res.data.task[k].application.longitude

					uni.getLocation({
						type: 'wgs84',
						success: function(res2) {
							let lng = res.data.longitude
							let lat = res.data.latitude
							console.log({
								lat1,
								lng1,
								lat,
								lng,
								x: res.data.task[k].application
							})
							that.countkm(lat, lng, lat1 * 1, lng1 * 1).then(res3 => {

								if (typeof res3.data != 'undefined') {
									let m = (res3.data.paths[0].distance / 1000).toFixed(2)
									if (m == 0) {
										that.riderdistance = '即将送达'
									} else if (m < 1) {
										that.riderdistance =
											`当前距离${res3.data.paths[0].distance}m`
									} else {
										that.riderdistance =
											`当前距离${res3.data.paths[0].distance}m`
									}
								}
							})

						},
						fail(err) {

						}
					});



					// riderdistance
				})
			},
			// 根据经纬度计算距离12321
			countkm(lat1, lng1, lat2, lng2) {
				return new Promise((resolve, reject) => {
					uni.request({
						url: `https://restapi.amap.com/v4/direction/bicycling?origin=${lng2},${lat2}&destination=${lng1},${lat1}&key=c858b6921758e3f3400070929386564c`,
					}).then((response) => {
						let [error, res] = response;
						resolve(res.data);
					}).catch(error => {
						let [err, res] = error;
						reject(err)
					});
				})
			},
			// 倒计时
			timer() {
				this.temp = setInterval(() => {
					this.djs = this.$countTime2(this.order.end_time);
					if (!this.djs) {
						clearInterval(this.temp);
						// 发送取消请求
						this.djs = ''
					}
				}, 1000)
				console.log('倒计时', this.djs);
			},
			// 关闭说明
			pop2Close() {
				this.$refs.popup2.close()
			},
			// 打开说明
			openPop2(index) {
				this.$refs.popup2.open();
				if (index == 1) {
					console.log('积分底线说明');
				}
				if (index == 2) {
					console.log('红包说明');
				}
				if (index == 3) {
					console.log('配送红包说明');
				}
				if (index == 4) {
					console.log('优惠券说明');
				}
			},
			// 拨打电话
			call(num) {
				uni.makePhoneCall({
					phoneNumber: String(num),
					success() {

					},
					fail(res) {
						console.log(res);
					}
				})
			},
			// 显示商品
			showAll() {
				this.showMore = !this.showMore;

			},
			// 复制订单号
			copy(value) {
				this.$copy(this.info.group_order_sn)
			},
			// 取消订单

			cancelOrder() {
				let _this = this
				this.choosecancelitem = this.info
				uni.showModal({
					content: '确认取消此订单吗？',
					confirmColor: '#F31E1E',
					success(res) {
						if (res.confirm) {
							console.log('取消订单');
							_this.$refs.popup5.open()
						}
					}
				})
				console.log('取消订单');

			},

			// 确认取消
			pop5Sure() {
				this.$refs.popup5.close();
				this.$refs.popup6.open();
			},
			// 关闭取消弹窗
			pop5Close() {
				this.$refs.popup5.close();
			},
			groupChange(n) {
				console.log('groupChange', n);
			},
			radioChange(n) {
				console.log('radioChange', n);
			},
			// 确认取消订单原因
			pop6Sure() {
				this.$refs.popup6.close();
				uni.showLoading({
					mask: true,
					title: "取消中"
				})
				this.$request('order/cancel/' + this.id, {
					reason: this.radiovalue1
				}).then(res => {
					if (res.status == 200) {
						uni.hideLoading()

						this.$showToast('取消成功')

						this.choosecancelitem = ''
						this.radiovalue1 = ''
						// this.getgoodsinfo()
						uni.navigateTo({
							url: `/pages/client/order/order`
						})
					}
				})
			},
			// 关闭取消订单原因弹窗
			pop6Close() {
				this.$refs.popup6.close();
			},
			// 删除订单
			delOrder(info) {
				let This = this
				uni.showModal({
					content: '确认删除此订单吗？',
					confirmColor: '#F31E1E',
					success(res) {
						if (res.confirm) {
							userDeleteGroupOrderApi(info.group_order_id).then(res=>{
								wx.showToast({
									title: '删除成功',
									icon: 'none'
								})
								uni.redirectTo({
									url: '/pages/client/order/order'
								})
							}).catch(err=>{
								wx.showToast({
									title: err.message,
									icon: 'none'
								})
							})
						}
					}
				})
				
				console.log('删除订单',info);
			},
			// 修改地址
			updateAddressOrder(id) {

				let that = this
				this.chooseid = id
				uni.showModal({
					content: '确认修改地址吗',
					confirmColor: '#F31E1E',
					success(res) {
						if (res.confirm) {
							that.changeaddr = true
							uni.navigateTo({
								url: '/pages/client/address-choose/address-choose?orgin=1'
							})
						}
					}
				})



			},
			// 去支付
			goPayOrder(id) {
				let _this = this
				this.choosecancelitem = this.info
				uni.showModal({
					content: '确认支付',
					confirmColor: '#F31E1E',
					success(res) {
						if (res.confirm) {

							_this.$refs.popup4.open()
						}
					}
				})

			},
			// 关闭支付弹窗
			pop4Close() {
				this.$refs.popup4.close()
			},
			// 再付款之前进行选择
			paychoose() {
				uni.showModal({
					title: "提示",
					content: "请选择支付方式",
					cancelText: '余额支付',
					confirmText: '微信支付',
					cancelColor: "#333",
					confirmColor: '#22B591',
					success: res => {
						if (res.confirm) {
							console.log('用户微信支付');
							this.pay()
						} else if (res.cancel) {
							console.log('用户余额支付');
							this.yuepay()

							this.$refs.popup4.close()
						}
					}
				})

			},
			// 付款

			pay() {

				uni.showLoading({
					mask: true,
					title: "支付中"
				})
				this.$request('order/pay/' + this.choosecancelitem.group_order_id, {
					type: 'routine'
				}).then(res => {
					if (res.status == 200) {
						uni.hideLoading()

						this.paying(res.data.result.config)

					}
				})


				this.$refs.popup4.close()
			},
			paying(e) {

				let that = this
				let orderInfo = {
					timeStamp: e.timestamp,
					nonceStr: e.nonceStr,
					package: e.package,
					signType: e.signType,
					paySign: e.paySign,
				}
				wx.requestPayment({
					...orderInfo,

					success: (res) => {
						uni.showToast({
							title: "支付成功",
							icon: "none"
						})

						this.choosecancelitem = ''
						this.radiovalue1 = ''
						this.chooseid = ''
						this.getgoodsinfo()
					},
					fail(e) {

						wx.showToast({
							title: '支付失败',
							icon: 'none'
						})

					}
				})

			},
			yuepay() {
				this.$request('order/pay/' + this.choosecancelitem.group_order_id, {
					type: 'balance'
				}).then(res => {
					if (res.status == 200) {
						uni.hideLoading()
						uni.showToast({
							title: "支付成功",
							icon: "none"
						})
                         this.choosecancelitem = ''
                         this.radiovalue1 = ''
                         this.chooseid = ''
                         this.getgoodsinfo()

					}
				})
			},

			// 修改配送时间
			updateDateOrder(id) {
				console.log('修改配送时间');
				this.$refs.popup3.open()
			},
			// 切换配送时间
			checkDate(index) {
				this.activeT = index
			},
			// 选择配送时间
			chooseTimes(index) {
				this.active2 = index;

				// this.$refs.popup3.close();


				let date
				if (this.date_list[this.activeT] == '今天') {
					date = this.getDay(0, 3600000)
				} else {
					date = this.getDay(1, 3600000)
				}

				let delivery_start_date = date + ' ' + this.times_list[this.active2].tips + this.times_list[this.active2]
					.start
				let delivery_end_date = date + ' ' + this.times_list[this.active2].tips + this.times_list[this.active2].end
				let delivery_time_scope = this.times_list[this.active2].start + '-' + this.times_list[this.active2].end

				let data = {
					group_order_id: this.id,
					delivery_start_date,
					delivery_end_date,
					delivery_time_scope
				}
				uni.showModal({
					title: '提示',
					content: '是否更改时间为' + this.date_list[this.activeT] + delivery_time_scope,
					success: res => {
						if (res.confirm) {
							uni.showLoading({
								mask: true
							})
							this.$request('order/change_delivery_time', data).then(res => {
								if (res.status == 200) {
									uni.hideLoading()
									this.$refs.popup3.close()

									this.chooseid = ''
									this.getgoodsinfo()

								}
							})
						} else if (res.cancel) {

						}
					}
				});

			},
			// 关闭配送时间弹窗
			pop3Close() {
				this.$refs.popup3.close()
			},
			// 催单
			// 催单
			reminderOrder(id) {
				// this.chooseid=id

				this.$request('user/urgeOrderTask', {
					order_id: id,
					content: ''
				}).then(res => {
					if (res.status == 200) {
						uni.hideLoading()
						this.cuifocontent = res.data.content
						this.cuifotitle = res.data.title
						this.$refs.popup7.open()

						this.getgoodsinfo()

					}
				})

			},
			// 关闭催单弹窗
			pop7Close() {
				this.$refs.popup7.close()
			},
			// 去评价
			goEvaluation(id) {
				console.log('去评价');
			},
			// 申请售后
			goAfterSales(id) {
				console.log('申请售后');
				uni.navigateTo({
					url: '/pages/client/order/apply-shouhou/apply-shouhou'
				})
			},
			// 再来一单
			againOrder(id) {
				let data = {
					data: []
				}
				this.info.orderList.forEach(cart => {
					cart.orderProduct.forEach(product => {
						data.data.push({
							product_id: product.product_id,
							product_attr_unique: product.product_sku,
							cart_num: product.product_num
						})
					})
				})
				let cartIds = []
				let cartS = []
				// getCartApi
				console.log(data, '再来一单');
				againApi(data).then(res => {
					cartIds = res.data.cart_id
					return orderCheckApi({
						address_id: "",
						takes: [],
						use_integral: false,
						cart_id: cartIds
					})
				}).then(res => {
					res.data.order.forEach(merOrder => {
						cartS.push(...merOrder.list)
					})
					Cache.set('cartToPayCheck', cartS)
					uni.navigateTo({
						url: '/pages/client/order/order-sure/order-sure?isagain=1',
						fail: (err) => {
							console.log(err)
						}
					})
				}).catch(err => {
					console.log(err)
				})




				// uni.navigateTo({
				// 	url: '/pages/client/order/order-sure/order-sure'
				// })
			},
			// 申请开票
			applyTicket(id) {
				console.log('申请开票');
				uni.navigateTo({
					url: '/pages/client/order/apply-kaipiao/apply-kaipiao'
				})
			},
			// 开票历史
			ticketHistory(id) {
				console.log('开票历史');
				uni.navigateTo({
					url: '/pages/client/order/history-kaipiao/history-kaipiao'
				})
			},
			// 差价说明
			ChajiaDesc(item) {
				// this.msbz = item.buyer_remarks
				this.$refs.popup8.open();
			},
			// 关闭差价弹窗
			pop8Close() {
				this.$refs.popup8.close();
			}
		}
	}
</script>
<style>
	page {
		background-color: #F5F5F5;
	}
</style>
<style lang="scss" scoped>
	.sureshbtn{
		width: 140rpx;height: 60rpx;background: linear-gradient(to right, #2BCCA5, #22B591);
		display: flex;
		align-items: center;
		justify-content: center;
		border-radius: 10rpx;
		color: #fff;
		font-size: 24rpx;
	}
	.box {
		padding-bottom: 32rpx;
		position: relative;

		.showColor {
			font-weight: bold;
			color: #F45E14;
		}

		.red {
			color: #F83535;
		}

		.bg {
			left: 0;
			top: 0;
			position: absolute;
			width: 750rpx;
			height: 210rpx;
			background: #109C7A;
		}

		.tag {
			margin-left: 15rpx;
			flex-shrink: 0;
			width: 11rpx;
			height: 20rpx;

			image {
				width: 100%;
				height: 100%;
			}
		}

		.list {
			position: relative;
			overflow: hidden;
			z-index: 2;

			&>view:nth-child(1) {
				margin: 50rpx auto 0;
			}
		}

		.card {
			margin: 0 auto;
			width: 690rpx;
			padding: 0 30rpx;
			background: #FFFFFF;
			border-radius: 20rpx;
			box-sizing: border-box;
		}

		.delColor {
			color: #999 !important;
		}

		.state {
			margin: 50rpx auto 0;
			padding: 0 40rpx;
			text-align: center;
			box-sizing: border-box;
			overflow: hidden;

			.state-desc {
				margin: 16rpx 0 28rpx;
			}

			.state-btn {
				&>view {
					flex-shrink: 0;
					width: 190rpx;
					height: 70rpx;
					line-height: 70rpx;
					font-size: 24rpx;
					text-align: center;
					background: #FFFFFF;
					border: 1rpx solid #CCCCCC;
					margin-bottom: 10rpx;
					border-radius: 10rpx;
				}

				&>view:not(:last-child) {
					margin-right: 20rpx;
				}

				.state1 {
					background: #F83535;
					border: 1rpx solid #F83535;
					color: #fff;
				}

				.state2 {
					background: linear-gradient(64deg, #2BCCA5, #22B591);
					box-shadow: 0rpx 4rpx 6rpx 0rpx rgba(20, 187, 146, 0.4);
					border: 1rpx solid #14BB92;
					color: #fff;
				}

				.state3 {
					background: #F5F5F5;
					border: 1rpx solid #F5F5F5;
					color: #999;
				}
			}
		}

		.msg {
			padding: 0;
			margin-top: 20rpx;

			.msg-title {
				padding: 28rpx 30rpx;
				border-bottom: 1rpx solid #eee;
			}

			.msg-buy {
				padding: 20rpx 30rpx 30rpx;

				.call-btn {
					padding: 6rpx 12rpx;
					font-size: 26rpx;
					color: #109C7A;
					border: 1rpx solid #EEEEEE;
					border-radius: 22rpx;
				}

				.rm {
					margin-top: 10rpx;
				}

				.msg-buy1 {
					flex-shrink: 0;
					width: 70rpx;
					height: 70rpx;

					image {
						width: 100%;
						height: 100%;
						border-radius: 50%;
					}
				}

				.msg-buy2 {
					flex: 1;
					margin-left: 14rpx;

					&>view:nth-child(1) {
						margin-bottom: 8rpx;
					}
				}
			}

		}

		.order {
			padding: 0 0 30rpx;
			margin-top: 20rpx;

			&>view {
				padding: 0 30rpx;
			}

			.title {
				padding: 26rpx 30rpx;
				border-bottom: 1rpx solid #eee;

				&>view:nth-child(2) {
					color: #109C7A;
				}

				.title-img {
					margin-right: 10rpx;
					width: 27rpx;
					height: 27rpx;

					image {
						width: 100%;
						height: 100%;
					}
				}
			}

			.order-list {
				margin-top: 5rpx;

				&>view:not(:first-child) {
					border-top: 1rpx solid #eee;
				}

				.shop {
					position: relative;
					transition: 3s;
					padding: 23rpx 0;

					.shouhou {
						right: 0;
						bottom: 30rpx;
						position: absolute;
						width: 140rpx;
						height: 54rpx;
						text-align: center;
						font-size: 22rpx;
						color: #666;
						line-height: 54rpx;
						background: #FFFFFF;
						border: 1rpx solid #CCCCCC;
						border-radius: 27rpx;
					}

					.shop-msg {
						width: 110rpx;
						height: 100rpx;
						flex-shrink: 0;

						image {
							width: 100%;
							height: 100%;
							border-radius: 12rpx;
						}
					}

					.shop-right {
						margin-left: 15rpx;
						flex: 1;
						min-height: 110rpx;

						.one {
							.shop-name {
								width: 308rpx;
							}

							.price1 {
								font-size: 24rpx;
								text-decoration: line-through;
								color: #999999;
							}

							.price2 {
								margin-left: 30rpx;
							}
						}

						.two,
						.three {
							font-size: 22rpx;
							color: #666;
						}

						.two {
							margin: 6rpx 0;
							height: 28rpx;
						}
					}
				}

				.chajia {
					position: relative;
					display: inline-block;
					margin-top: 10rpx;
					font-size: 22rpx;
					color: #109C7A;

					.img2 {
						top: -2rpx;
						right: -25rpx;
						position: absolute;
						width: 22rpx;
						height: 22rpx;

						image {
							width: 100%;
							height: 100%;
						}
					}
				}

			}

			// 
			.num {
				width: 630rpx;
				height: 40rpx;
				margin: 0 auto 26rpx;
				background: #FAFAFA;
				color: #999999;
				font-size: 22rpx;
				box-sizing: border-box;

				.tag2 {
					margin-left: 10rpx;
					width: 16rpx;
					height: 9rpx;

					image {
						width: 100%;
						height: 100%;
					}
				}
			}

			// 费
			.fee1 {}

			.fee2 {
				margin-top: 36rpx;
			}

			// 红包类型
			.demo {
				margin-top: 36rpx;

				.img1 {
					width: 28rpx;
					height: 30rpx;

					image {
						width: 100%;
						height: 100%;
					}
				}

				.title2 {
					position: relative;
					margin-left: 10rpx;
					font-size: 28rpx;

					.img2 {
						top: -2rpx;
						right: -25rpx;
						position: absolute;
						width: 22rpx;
						height: 22rpx;

						image {
							width: 100%;
							height: 100%;
						}
					}
				}
			}

			.dixian {
				padding-left: 40rpx;
				margin-top: 10rpx;

				.dixian-img {
					width: 30rpx;
					height: 30rpx;

					image {
						width: 100%;
						height: 100%;
					}
				}
			}

			// 优惠
			.youhui {
				margin-top: 60rpx;

				.yyh {
					margin-top: 2rpx;
				}

				.xiaoji {
					// margin-top: 4rpx;
				}

				.youhui-total {
					position: relative;
				}

				.sanjiao {
					position: absolute;
					bottom: -20rpx;
					left: 50%;
					transform: translateX(-50%);
					width: 0;
					height: 0;
					border-bottom: 20rpx solid #FDECD7;
					border-right: 12rpx solid transparent;
					border-left: 12rpx solid transparent;
				}
			}

			.yh-plus {
				margin: 20rpx auto 0;
				width: 630rpx;
				padding: 0 13rpx;
				height: 86rpx;
				line-height: 86rpx;
				font-size: 26rpx;
				background: linear-gradient(0deg, #FFE0B4 0%, #FDECD7 100%);
				border-radius: 8rpx;
				box-sizing: border-box;

				.img3 {
					width: 30rpx;
					height: 26rpx;

					image {
						width: 100%;
						height: 100%;
					}
				}

				.tag3 {
					margin: 0 10rpx;
					width: 1rpx;
					height: 25rpx;
					background: #4D2F12;
				}
			}
		}

		.orange {
			color: #F45E14;
		}

		// 配送信息
		.ps-msg,
		.order-msg,
		.note {
			margin: 20rpx auto 0;
			padding: 0;

			.title {
				padding: 26rpx 30rpx;
				border-bottom: 1rpx solid #eee;
				font-size: 28rpx;
				font-weight: bold;
			}

			.p2 {
				&>view:nth-child(1) {
					margin-bottom: 25rpx;
				}

				padding: 26rpx 30rpx;
				font-size: 26rpx;

				.label {
					flex-shrink: 0;
					width: 130rpx;
					font-size: 26rpx;
				}

				.label+view {
					flex: 1;
					line-height: 40rpx;
				}
			}
		}

		// 备注
		.note {
			.p2 {
				line-height: 44rpx;
			}
		}

		// 底部删除按钮
		.bottom2 {
			position: fixed;
			left: 0;
			bottom: 0;
			width: 750rpx;
			height: 120rpx;
			background: #FFFFFF;
			z-index: 101;
			text-align: right;
			border-top: 1rpx solid #eee;
			box-sizing: border-box;

			&>view {
				margin: 25rpx 60rpx 25rpx;
				display: inline-block;
				width: 190rpx;
				height: 70rpx;
				line-height: 70rpx;
				text-align: center;
				font-size: 26rpx;
				background: #FFFFFF;
				border: 1rpx solid #CCCCCC;
				border-radius: 10rpx;
			}
		}

		// 说明弹窗
		.pop2 {
			.pop2-content {
				width: 560rpx;
				padding: 40rpx;
				background: #FFFFFF;
				border-radius: 20rpx;
				box-sizing: border-box;
			}

			.pop2-close {
				margin: 22rpx auto 0;
				width: 58rpx;
				height: 58rpx;

				image {
					width: 100%;
					height: 100%;
				}
			}
		}

		// 配送时间弹窗
		.pop3 {
			position: relative;
			width: 750rpx;
			height: 540rpx;
			background: #FFFFFF;
			border-radius: 20rpx 20rpx 0rpx 0rpx;
			overflow: hidden;

			.green2 {
				color: #109C7A;
			}

			.pop3-close {
				position: absolute;
				top: 15rpx;
				right: 30rpx;
				width: 38rpx;
				height: 38rpx;

				image {
					width: 100%;
					height: 100%;
				}
			}

			.pop3-title {
				margin-top: 36rpx;
			}

			.pop3-box {
				height: 458rpx;
				font-size: 28rpx;

				.pop3-left {
					width: 140rpx;
					height: 458rpx;
					background-color: #FAFAFA;

					&>view {
						padding: 30rpx 0;
					}
				}

				.pop3-right {
					flex: 1;
					height: 458rpx;
					overflow-y: auto;

					&>view {
						padding: 30rpx 30rpx;
					}

					.pop3-img {
						width: 38rpx;
						height: 34rpx;

						image {
							width: 100%;
							height: 100%;
						}
					}
				}
			}
		}

		// 支付弹窗
		.pop4 {
			position: relative;
			width: 750rpx;
			height: 670rpx;
			padding: 0 30rpx;
			background: #FFFFFF;
			border-radius: 20rpx 20rpx 0rpx 0rpx;
			overflow: hidden;
			box-sizing: border-box;

			.pop4-close {
				position: absolute;
				top: 15rpx;
				right: 30rpx;
				width: 38rpx;
				height: 38rpx;

				image {
					width: 100%;
					height: 100%;
				}
			}

			.pop4-title {
				padding: 30rpx 0;
			}

			.pop4-desc {
				padding: 16rpx 20rpx;
				color: #F45E14;
				font-size: 24rpx;
				background: #FAFAFA;
			}

			.pop4-list {
				height: 370rpx;
				overflow-y: auto;

				&>view {
					padding-top: 40rpx;
				}
			}

			.pop4-btn {
				width: 750rpx;
				height: 140rpx;
				background: #FFFFFF;
				font-size: 32rpx;
				color: #fff;
				text-align: center;

				&>view {
					width: 335rpx;
					height: 100rpx;
					line-height: 100rpx;
					background: linear-gradient(64deg, #7AD9C3, #70D5BD);
					border-radius: 50rpx 0rpx 0rpx 50rpx;
				}

				&>view:nth-child(2) {
					background: linear-gradient(64deg, #2BCCA5, #22B591);
					border-radius: 0rpx 50rpx 50rpx 0rpx;
				}
			}
		}

		// 取消订单原因弹窗
		.pop6 {
			position: relative;
			width: 620rpx;
			background: #FFFFFF;
			border-radius: 20rpx;
			overflow: hidden;
			box-sizing: border-box;

			.pop6-title {
				padding: 36rpx 0;
			}

			.pop6-list {
				// height: 400rpx;
				padding: 0 40rpx;
			}

			.pop6-btn {
				border-top: 1rpx solid #eee;
				height: 90rpx;

				&>view {
					width: 50%;
					line-height: 90rpx;
				}

				&>view:nth-child(1) {
					border-right: 1rpx solid #eee;
				}
			}
		}

		// 催单弹窗
		.pop7 {
			width: 490rpx;
			height: 590rpx;
			padding: 30rpx 0;
			background: #FFFFFF;
			border-radius: 48rpx;
			box-sizing: border-box;

			.pop7-img {
				margin: 0 auto;
				width: 455rpx;
				height: 455rpx;

				image {
					width: 100%;
					height: 100%;
				}
			}

			.tr {
				margin-top: -154rpx;

				.pop7-desc {
					margin: 20rpx 0 45rpx;
				}

				.pop7-btn {
					margin: 0 auto;
					width: 300rpx;
					height: 80rpx;
					color: #fff;
					font-size: 30rpx;
					line-height: 80rpx;
					background: linear-gradient(64deg, #2BCCA5, #22B591);
					border-radius: 40rpx;
				}
			}
		}

		// 差价弹窗说明
		.pop8 {
			position: relative;
			width: 750rpx;
			// height: 540rpx;
			background: #FFFFFF;
			border-radius: 20rpx 20rpx 0rpx 0rpx;
			overflow: hidden;
			box-sizing: border-box;

			.pop8-close {
				position: absolute;
				top: 15rpx;
				right: 30rpx;
				width: 38rpx;
				height: 38rpx;

				image {
					width: 100%;
					height: 100%;
				}
			}

			.pop8-title {
				padding: 30rpx 0;
			}

			.pop8-desc {
				min-height: 250rpx;
				padding: 30rpx 25rpx;
				font-size: 26rpx;
				line-height: 46rpx;
			}

			.pop8-btn {
				width: 750rpx;
				height: 100rpx;
				line-height: 100rpx;
				font-size: 32rpx;
				color: #fff;
				text-align: center;
				background: linear-gradient(64deg, #2BCCA5, #22B591);
			}
		}
	}
</style>
